package com.yueshang.neuron.common.enums;

public enum ResultCodeEnum {

    OPERATION_SUCCESS(10000, "操作成功"),
    GAIN_SUCCESS(10001, "成功获取数据，数据非空"),
    GAIN_SUCCESS_EMPTY(10002, "操作成功,数据为空"),
    OPERATION_FAIL(20000, "操作失败"),
    PARM_ERRO(20001, "参数错误"),
    EXCEPTION_FAIL(20002, "异常报错"),
    SOCKET_CON_FAIL(20003, "Sockt 连接失败"),
    UNAUTH_ERRO(20004, "未登录"),
    FORBB_ERRO(20005, "无权限"),
    NOT_ACCEPTABLE(20006,"未签名"),
    DISABLE_ACCOUNT(20007, "账号被冻结"),
    USER_PASSWORD_ERRO(20008, "账号密码错误");

    private int code;
    private String msg;

    ResultCodeEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public static String valueOf(Integer value) {
        if (value == null) {
            return "";
        } else {
            for (ManagerStatusEnum ms : ManagerStatusEnum.values()) {
                if (ms.getCode() == value) {
                    return ms.getMessage();
                }
            }
            return "";
        }
    }
}
